package JackSu.常用类.时间日期类;


import java.util.Calendar;
import java.util.Date;

public class _03日历类的使用 {
    /**
     *abstract修饰的就不能实例化了，只能调他的实现方法或者自身的静态方法
     */


    public static void main(String[] args) {
        //常用方法
        //get
        Calendar instance = Calendar.getInstance();
        System.out.println(instance.get(Calendar.DAY_OF_WEEK));
        System.out.println(instance.get(Calendar.DAY_OF_MONTH));

        //set()
        instance.set(Calendar.DAY_OF_MONTH,22);
        int i = instance.get(Calendar.DAY_OF_MONTH) ;
        System.out.println(i);;


        //add()
        instance.add(Calendar.DAY_OF_MONTH,3);

        int j = instance.get(Calendar.DAY_OF_MONTH) ;
        System.out.println(j);;

        //getTime()
        Date time = instance.getTime();
        System.out.println(time);


        //setTime()
        instance.setTime(new Date());
        System.out.println(instance.getTime());

    }


}
